﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xman.Dashboard.Logger.Sqlite
{
    public class LogDto
    {
        public int Index { get; set; }
        public string WriteTime { get; set; }
        public string Level { get; set; }
        public string ActivityId { get; set; }
        public string CallSite { get; set; }
        public string Message { get; set; }
    }

    public class LogModelInput
    {
        public int? PageIndex { get; set; }
        public int? PageSize { get; set; }
        public string WriteDateHour { get; set; }
        public string WriteDate => WriteDateHour.Split("_")[0];
        public string Keywords { get; set; }
        public string FilePath => $@"{AppDomain.CurrentDomain.BaseDirectory}logs\{WriteDate.Replace("-", "")}\{WriteDateHour}.log";
    }

    public class PageData<T> where T : class
    {
        /// <summary>
        /// 第几页
        /// </summary>
        public int? PageIndex { get; set; }

        /// <summary>
        /// 页面大小
        /// </summary>
        public int? PageSize { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageTotal { get; set; }

        /// <summary>
        /// 返回结果集
        /// </summary>
        public List<T> ResultT { get; set; }
    }
}
